<html>
<head>
<title>
Ssh - Helma Javascript Reference
</title>

<meta http-equiv="Content-Script-Type" content="text/javascript">
<script src="scripts.js"></script>
<link rel="stylesheet" href="styles.css" media="screen" />
    <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
    <script type="text/javascript">_uacct = "UA-737027-2";urchinTracker();</script>
<style>
td {
    font-family: "Trebuchet MS", sans-serif; 
    font-size: 13px; 
    line-height:135%;
}
.columnheight {
    height: 1350px;
}
</style>
</head>
<body bgcolor="white">

<div class="frame">

<img class="home" onclick="location='http://dev.helma.org/'" src="helmaheader.gif" /><br />
<div class="lead">
    <p>Detailed reference of prototypes, properties and methods available in the <br />
    Javascript environment of your Helma web applications.</p>
</div>

<script> openbox('content') </script>


    <div class="content">
        <div class="docs">
        
            <!--
            <div class="sectionHead">Library: Ssh.js</div>
            -->
            <div class="section overview">
            <!--
                <div class="itemTitle">
                    Overview
                </div>
            -->
                <div>   
                    <div class="desc">Fields and methods of the helma.Ssh class.
<br /><br />
To use this optional module, its repository needs to be added to the 
application, for example by calling app.addRepository('modules/helma/Ssh.js')</div>
                    <div class="itemTags">
            <!--
                    <ul>
                        
                    
                    </ul>
            -->
                    </div>
                </div>
            </div>
            
            <!--
            <div class="sectionHead">Constructors</div>
            -->
            
            
            <div class="section constructor">
                <div class="itemTitle">
                    <a name="helma.Ssh"></a>
                    
                    
                        <i><a href="#helma" class="type">helma</a>
                        <span class="symbolname">Ssh</span>(<span class="signature">server, hosts</span>)</i>
                    
                    
                    
                </div>
                
                
                    <div class="desc">Creates a new instance of helma.Ssh</div>
                
                
                
                
                
                
                
                
                <div class="detailHead">parameters</div>
                <table class="params">
                
                    <tr>
                        <td class="type">
                            String
                        </td>
                        <td>
                            server
                        </td>
                        <td>
                            The server to connect to
                        </td> 
                    </tr>
                
                    <tr>
                        <td class="type">
                            helma.File, java.io.File, String
                        </td>
                        <td>
                            hosts
                        </td>
                        <td>
                            Either a file
containing a list of known hosts, or the path pointing to a
file. This argument is optional.
                        </td> 
                    </tr>
                
                </table>
                
                
                
                <div class="detailHead">methods</div>
                
                    <ul class="details">
                        <li><a href="#helma.Ssh.addKnownHosts">addKnownHosts</a>(file)</li>
                    </ul>
                
                    <ul class="details">
                        <li><a href="#helma.Ssh.connect">connect</a>(username, password)</li>
                    </ul>
                
                    <ul class="details">
                        <li><a href="#helma.Ssh.connectWithKey">connectWithKey</a>(username, key, passphrase)</li>
                    </ul>
                
                    <ul class="details">
                        <li><a href="#helma.Ssh.disconnect">disconnect</a>()</li>
                    </ul>
                
                    <ul class="details">
                        <li><a href="#helma.Ssh.isConnected">isConnected</a>()</li>
                    </ul>
                
                    <ul class="details">
                        <li><a href="#helma.Ssh.put">put</a>(localFile, remoteDir, mode)</li>
                    </ul>
                
                    <ul class="details">
                        <li><a href="#helma.Ssh.get">get</a>(remoteFile, targetDir)</li>
                    </ul>
                
                    <ul class="details">
                        <li><a href="#helma.Ssh.execCommand">execCommand</a>(cmd)</li>
                    </ul>
                
                    <ul class="details">
                        <li><a href="#helma.Ssh.setParanoid">setParanoid</a>(p)</li>
                    </ul>
                
                    <ul class="details">
                        <li><a href="#helma.Ssh.isParanoid">isParanoid</a>()</li>
                    </ul>
                
                
                
                
                
                
                
                

                

            </div>
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            <!--
            <div class="sectionHead">Namespaces</div>
            -->
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            <!--
            <div class="sectionHead">Properties</div>
            -->
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            

            <!--
            <div class="sectionHead">Constructors</div>
            -->
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            <div class="sectionHead">Methods</div>
            
            
            
            
            <div class="section function">
                <div class="itemTitle">
                    <a name="helma.Ssh.addKnownHosts"></a>
                    
                    
                        <i><a href="#helma.Ssh" class="type">helma.Ssh</a>.
                        <span class="symbolname">addKnownHosts</span>(<span class="signature">file</span>)</i>
                    
                    
                    
                </div>
                
                
                    <div class="desc">Opens the file passed as argument and adds the known hosts
therein to the list of known hosts for this client.</div>
                

                
                
                
                
                
                <div class="detailHead">parameters</div>
                <table class="params">
                
                    <tr>
                        <td class="type">
                            helma.File, java.io.File, String
                        </td>
                        <td>
                            file
                        </td>
                        <td>
                            Either a file object
or the path to a file containing a list of known hosts
                        </td> 
                    </tr>
                
                </table>
                
                
                
                <div class="detailHead">returns</div>
                <table class="params">
                
                    <tr>
                        <td class="type">
                            
                        </td>
                        <td>
                            True if adding the list was successful, false otherwise
                        </td> 
                    </tr>
                
                </table>
                
                
                

                

            </div>
            
            
            
            <div class="section function">
                <div class="itemTitle">
                    <a name="helma.Ssh.connect"></a>
                    
                    
                        <i><a href="#helma.Ssh" class="type">helma.Ssh</a>.
                        <span class="symbolname">connect</span>(<span class="signature">username, password</span>)</i>
                    
                    
                    
                </div>
                
                
                    <div class="desc">Connects to a remote host using plain username/password authentication.</div>
                

                
                
                
                
                
                <div class="detailHead">parameters</div>
                <table class="params">
                
                    <tr>
                        <td class="type">
                            String
                        </td>
                        <td>
                            username
                        </td>
                        <td>
                            The username
                        </td> 
                    </tr>
                
                    <tr>
                        <td class="type">
                            String
                        </td>
                        <td>
                            password
                        </td>
                        <td>
                            The password
                        </td> 
                    </tr>
                
                </table>
                
                
                
                <div class="detailHead">returns</div>
                <table class="params">
                
                    <tr>
                        <td class="type">
                            
                        </td>
                        <td>
                            True in case the connection attempt was successful, false otherwise.
                        </td> 
                    </tr>
                
                </table>
                
                
                

                

            </div>
            
            
            
            <div class="section function">
                <div class="itemTitle">
                    <a name="helma.Ssh.connectWithKey"></a>
                    
                    
                        <i><a href="#helma.Ssh" class="type">helma.Ssh</a>.
                        <span class="symbolname">connectWithKey</span>(<span class="signature">username, key, passphrase</span>)</i>
                    
                    
                    
                </div>
                
                
                    <div class="desc">Connects to a remote host using a private key and the corresponding
passphrase.</div>
                

                
                
                
                
                
                <div class="detailHead">parameters</div>
                <table class="params">
                
                    <tr>
                        <td class="type">
                            String
                        </td>
                        <td>
                            username
                        </td>
                        <td>
                            The username
                        </td> 
                    </tr>
                
                    <tr>
                        <td class="type">
                            helma.File, java.io.File, String
                        </td>
                        <td>
                            key
                        </td>
                        <td>
                            Either a file object
representing the private key file, or the path to it.
                        </td> 
                    </tr>
                
                    <tr>
                        <td class="type">
                            String
                        </td>
                        <td>
                            passphrase
                        </td>
                        <td>
                            The passphrase of the private key, if necessary.
                        </td> 
                    </tr>
                
                </table>
                
                
                
                <div class="detailHead">returns</div>
                <table class="params">
                
                    <tr>
                        <td class="type">
                            
                        </td>
                        <td>
                            True in case the connection attempt was successful, false otherwise.
                        </td> 
                    </tr>
                
                </table>
                
                
                

                

            </div>
            
            
            
            <div class="section function">
                <div class="itemTitle">
                    <a name="helma.Ssh.disconnect"></a>
                    
                    
                        <i><a href="#helma.Ssh" class="type">helma.Ssh</a>.
                        <span class="symbolname">disconnect</span>(<span class="signature"></span>)</i>
                    
                    
                    
                </div>
                
                
                    <div class="desc">Disconnects this client from the remote server.</div>
                

                
                
                
                
                
                
                
                
                

                

            </div>
            
            
            
            <div class="section function">
                <div class="itemTitle">
                    <a name="helma.Ssh.isConnected"></a>
                    
                    
                        <i><a href="#helma.Ssh" class="type">helma.Ssh</a>.
                        <span class="symbolname">isConnected</span>(<span class="signature"></span>)</i>
                    
                    
                    
                </div>
                
                
                    <div class="desc">Returns true if this client is currently connected.</div>
                

                
                
                
                
                
                
                
                <div class="detailHead">returns</div>
                <table class="params">
                
                    <tr>
                        <td class="type">
                            
                        </td>
                        <td>
                            True in case this client is connected, false otherwise.
                        </td> 
                    </tr>
                
                </table>
                
                
                

                

            </div>
            
            
            
            <div class="section function">
                <div class="itemTitle">
                    <a name="helma.Ssh.put"></a>
                    
                    
                        <i><a href="#helma.Ssh" class="type">helma.Ssh</a>.
                        <span class="symbolname">put</span>(<span class="signature">localFile, remoteDir, mode</span>)</i>
                    
                    
                    
                </div>
                
                
                    <div class="desc">Copies a local file to the remote server</div>
                

                
                
                
                
                
                <div class="detailHead">parameters</div>
                <table class="params">
                
                    <tr>
                        <td class="type">
                            String, Array
                        </td>
                        <td>
                            localFile
                        </td>
                        <td>
                            Either the path to a single local
file or an array containing multiple file paths that should be
copied to the remote server.
                        </td> 
                    </tr>
                
                    <tr>
                        <td class="type">
                            String
                        </td>
                        <td>
                            remoteDir
                        </td>
                        <td>
                            The path to the remote destination directory
                        </td> 
                    </tr>
                
                    <tr>
                        <td class="type">
                            String
                        </td>
                        <td>
                            mode
                        </td>
                        <td>
                            An optional 4-digit permission mode string (eg.
<code>0755</code>);
                        </td> 
                    </tr>
                
                </table>
                
                
                
                <div class="detailHead">returns</div>
                <table class="params">
                
                    <tr>
                        <td class="type">
                            
                        </td>
                        <td>
                            True in case the operation was successful, false otherwise.
                        </td> 
                    </tr>
                
                </table>
                
                
                

                

            </div>
            
            
            
            <div class="section function">
                <div class="itemTitle">
                    <a name="helma.Ssh.get"></a>
                    
                    
                        <i><a href="#helma.Ssh" class="type">helma.Ssh</a>.
                        <span class="symbolname">get</span>(<span class="signature">remoteFile, targetDir</span>)</i>
                    
                    
                    
                </div>
                
                
                    <div class="desc">Retrieves a file from the remote server and stores it locally.</div>
                

                
                
                
                
                
                <div class="detailHead">parameters</div>
                <table class="params">
                
                    <tr>
                        <td class="type">
                            String, Array
                        </td>
                        <td>
                            remoteFile
                        </td>
                        <td>
                            Either the path to a single remote
file or an array containing multiple file paths that should be
copied onto the local disk.
                        </td> 
                    </tr>
                
                    <tr>
                        <td class="type">
                            String
                        </td>
                        <td>
                            targetDir
                        </td>
                        <td>
                            The path to the local destination directory
                        </td> 
                    </tr>
                
                </table>
                
                
                
                <div class="detailHead">returns</div>
                <table class="params">
                
                    <tr>
                        <td class="type">
                            
                        </td>
                        <td>
                            True if the copy process was successful, false otherwise.
                        </td> 
                    </tr>
                
                </table>
                
                
                

                

            </div>
            
            
            
            <div class="section function">
                <div class="itemTitle">
                    <a name="helma.Ssh.execCommand"></a>
                    
                    
                        <i><a href="#helma.Ssh" class="type">helma.Ssh</a>.
                        <span class="symbolname">execCommand</span>(<span class="signature">cmd</span>)</i>
                    
                    
                    
                </div>
                
                
                    <div class="desc">Executes a single command on the remote server.</div>
                

                
                
                
                
                
                <div class="detailHead">parameters</div>
                <table class="params">
                
                    <tr>
                        <td class="type">
                            String
                        </td>
                        <td>
                            cmd
                        </td>
                        <td>
                            The command to execute on the remote server.
                        </td> 
                    </tr>
                
                </table>
                
                
                
                <div class="detailHead">returns</div>
                <table class="params">
                
                    <tr>
                        <td class="type">
                            
                        </td>
                        <td>
                            The result of the command execution
                        </td> 
                    </tr>
                
                </table>
                
                
                

                

            </div>
            
            
            
            <div class="section function">
                <div class="itemTitle">
                    <a name="helma.Ssh.setParanoid"></a>
                    
                    
                        <i><a href="#helma.Ssh" class="type">helma.Ssh</a>.
                        <span class="symbolname">setParanoid</span>(<span class="signature">p</span>)</i>
                    
                    
                    
                </div>
                
                
                    <div class="desc">Toggles paranoid mode. If set to true this client tries to
verify the host key against the its list of known hosts
during connection and rejects if the host key is not found
therein or is different.</div>
                

                
                
                
                
                
                <div class="detailHead">parameters</div>
                <table class="params">
                
                    <tr>
                        <td class="type">
                            Boolean
                        </td>
                        <td>
                            p
                        </td>
                        <td>
                            Either true or false
                        </td> 
                    </tr>
                
                </table>
                
                
                
                
                

                

            </div>
            
            
            
            <div class="section function">
                <div class="itemTitle">
                    <a name="helma.Ssh.isParanoid"></a>
                    
                    
                        <i><a href="#helma.Ssh" class="type">helma.Ssh</a>.
                        <span class="symbolname">isParanoid</span>(<span class="signature"></span>)</i>
                    
                    
                    
                </div>
                
                
                    <div class="desc">Returns true if this client is in paranoid mode.</div>
                

                
                
                
                
                
                
                
                <div class="detailHead">returns</div>
                <table class="params">
                
                    <tr>
                        <td class="type">
                            
                        </td>
                        <td>
                            Boolean
                        </td> 
                    </tr>
                
                </table>
                
                
                

                
                <div class="detailHead">see</div>
                <table class="params">
                
                    <tr><td class="type"><div class="see"><a href="helma.Ssh.html#helma.Ssh.setParanoid">helma.Ssh.setParanoid</a></div></td></tr>
                
                </table>
                

            </div>
            
            
            
        </div>
    </div>
    <div class="finePrint">
    Fri, 05 Feb 2010 17:40:05 GMT.
    </div>

<script> closebox() </script>

<script> openbox('pageintro') </script>

    <h3>core framework</h3>
        <ul>            
            <li><a href="global.html">global</a></li>
            <li><a href="app.html">app (application)</a></li>
            <li><a href="req.html">req (request)</a></li>
            <li><a href="res.html">res (response)</a></li>
            <li><a href="session.html">session</a></li>
            <li><a href="global.html#path">path</a></li>
            <li><a href="global.html#root">root</a></li>
            <li><a href="HopObject.html">HopObject</a></li>
            <li><a href="User.html">User</a></li>
            <li><a href="File.html">File</a></li>
            <li><a href="FtpClient.html">FtpClient</a></li>
            <li><a href="Image.html">Image</a></li>
            <li><a href="Mail.html">Mail</a></li>
            <li><a href="global.html#Remote">Remote</a></li>
            <li><a href="Xml.html">Xml</a></li>
            <li><a href="DatabaseObject.html">DatabaseObject</a></li>
            <li><a href="MimePart.html">MimePart</a></li>
            <li><a href="Skin.html">Skin</a></li>
            <li><a href="global.html#Object.dontEnum">Object</a></li>
        </ul>
        
    <h3>optional modules</h3>
        <ul>            
            <li><a href="ArrayExtensions.html">Array extensions</a></li>
            <li><a href="DateExtensions.html">Date extensions</a></li>
            <li><a href="NumberExtensions.html">Number extensions</a></li>
            <li><a href="ObjectExtensions.html">Object extensions</a></li>
            <li><a href="StringExtensions.html">String extensions</a></li>
            <li><a href="HopObjectExtensions.html">HopObject extensions</a></li>
            <li><a href="GlobalMacros.html">global macros</a></li>
            <li><a href="MacroFilters.html">macro filters</a></li>
            <li><a href="JSON.html">JSON methods</a></li>
            <br />
            <li><a href="helma.Aspects.html">helma.Aspects</a></li>
            <li><a href="helma.Chart.html">helma.Chart</a></li>
            <li><a href="helma.Color.html">helma.Color</a></li>
            <li><a href="helma.Database.html">helma.Database</a></li>
            <li><a href="helma.File.html">helma.File</a></li>
            <li><a href="helma.Ftp.html">helma.Ftp</a></li>
            <li><a href="helma.Group.html">helma.Group</a></li>
            <li><a href="helma.Html.html">helma.Html</a></li>
            <li><a href="helma.Http.html">helma.Http</a></li>
            <li><a href="helma.Image.html">helma.Image</a></li>
            <li><a href="helma.Mail.html">helma.Mail</a></li>
            <li><a href="helma.Search.html">helma.Search</a></li>
            <li><a href="helma.Skin.html">helma.Skin</a></li>
            <li><a href="helma.Ssh.html">helma.Ssh</a></li>
            <li><a href="helma.Url.html">helma.Url</a></li>
            <li><a href="helma.Zip.html">helma.Zip</a></li>
            <br />
            <li><a href="jala.BitTorrent.html">jala.BitTorrent</a></li>
            <li><a href="jala.Captcha.html">jala.Captcha</a></li>
            <li><a href="jala.Date.html">jala.Date</a></li>
            <li><a href="jala.db.html">jala.db</a></li>
            <li><a href="jala.DnsClient.html">jala.DnsClient</a></li>
            <li><a href="jala.Form.html">jala.Form</a></li>
            <li><a href="jala.History.html">jala.History</a></li>
            <li><a href="jala.HopObjectExtensions.html">jala HopObject extensions</a></li>
            <li><a href="jala.HtmlDocument.html">jala.HtmlDocument</a></li>
            <li><a href="jala.I18n.html">jala.I18n</a></li>
            <li><a href="jala.ImageFilter.html">jala.ImageFilter</a></li>
            <li><a href="jala.IndexManager.html">jala.IndexManager</a></li>
            <li><a href="jala.ListRenderer.html">jala.ListRenderer</a></li>
            <li><a href="jala.Mp3.html">jala.Mp3</a></li>
            <li><a href="jala.PodcastWriter.html">jala.PodcastWriter</a></li>
            <li><a href="jala.RemoteContent.html">jala.RemoteContent</a></li>
            <li><a href="jala.Rss20Writer.html">jala.Rss20Writer</a></li>
            <li><a href="jala.Utilities.html">jala.Utilities</a></li>
            <li><a href="jala.XmlRpcRequest.html">jala.XmlRpcRequest</a></li>
            <li><a href="jala.XmlWriter.html">jala.XmlWriter</a></li>
        </ul>
    
    <h3>java libraries</h3>
        <ul>            
            <li><a href="http://www.docjar.org/">docjar search</a></li>
        </ul>

    <h3>properties files</h3>
        <ul>            
            <li><a href="http://dev.helma.org/docs/Properties+Files/apps.properties/">apps.properties</a></li>
            <li><a href="http://dev.helma.org/docs/Properties+Files/app.properties/">app.properties</a></li>
            <li><a href="http://dev.helma.org/docs/Properties+Files/server.properties/">server.properties</a></li>
            <li><a href="http://dev.helma.org/docs/Properties+Files/db.properties/">db.properties</a></li>
            <li><a href="http://dev.helma.org/docs/Properties+Files/class.properties/">class.properties</a></li>
            <li><a href="http://dev.helma.org/docs/Type.properties+Documentation/">type.properties</a></li>
         </ul>
    
<script> closebox() </script>

</div>
<br clear="all" /><br /><br />



</body>
</html>
